function login() {
    var userName = $("#userName").val();
    var password = $("#password").val();
    var vertify = $("#vertify").val();
    console.log('userName', userName);
    console.log('password', password);
    console.log('vertify', vertify);
    var paramas = {
        'userName': userName,
        'password': password,
        'vertify': vertify
    }
    // CoreUtil.sendPost("http://localhost:8081/user/login")
    $.ajax({
        url: 'http://localhost:8081/user/login',
        data: paramas,
        type: 'post',
        dataType: "json",
        success: function (res) {
            if (res.code == 200) {
                console.log(res);
                console.log( res.data.userInfo.userName);
                // layer.msg(res.msg, { icon: 1,time: 10000 });
                // CoreUtil.setData("userName", res.data);
               sessionStorage.setItem("userName", res.data.userInfo.userName);
               sessionStorage.setItem("userTicket", res.data.token);
                window.location.href = "../../index.html"
            } else {
                layer.msg(res.msg, { icon: 7 });
                var loginImg = document.getElementById("kaptchaImg");
	        	loginImg.src = "http://localhost:8081/image/getKaptchaImage?time=" + new Date();
            }
        },
        error: function (err) {
            layer.msg("服务器好像除了点问题！请稍后试试", { icon: 7 });
        }
    })
}

// 点击更换验证码
function getKaptchaImage() {
   
        var loginImg = document.getElementById("kaptchaImg");
		loginImg.src = "http://localhost:8081/image/getKaptchaImage?time=" + new Date();
}
    